import java.util.Scanner;

public class GuessNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String again;
        do {
            int answer = (int)(Math.random()*100+1);
            int chances = 7;
            while (chances>0){
                System.out.println("cai ge shu,"+chances+"ci ji hui ");
                int guess;
                try {
                    guess = scanner.nextInt();
                }catch (Exception e){
                    System.out.println("bu he fa");
                    scanner.next();
                    continue;
                }
                if (guess == -1){
                    break;
                }else if (guess>answer){
                    System.out.println("da le");
                }else if (guess<answer){
                    System.out.println("xiao le");
                }else {
                    System.out.println("ok");
                    break;
                }
                chances = chances-1;
            }
            if (chances<=0){
                System.out.println("nonono");
            }

            System.out.println("again?  (y/n)");
            again = scanner.next();
        }while (again.equalsIgnoreCase("y"));





    }
}
